package com.sw.render.png;

import java.awt.Color;
import java.util.HashMap;
import java.util.Map;

import net.exfidefortis.colorselect.AwtColorSelector;

import com.sw.util.ReqParam;

/**
 * This class initializes the sets of colors for different parameters (ex.
 * speed, consumption)
 * 
 * @author tlapusan
 */
public class ColorSet {
	private Map<String, AwtColorSelector> mapColors;
	private Map<String, Integer> minValues;
	private Map<String, Integer> maxValues;

	public ColorSet() {
		mapColors = new HashMap<String, AwtColorSelector>();
		minValues = new HashMap<String, Integer>();
		maxValues = new HashMap<String, Integer>();

		// used for speed profile
		Map<Integer, Color> speeds = new HashMap<Integer, Color>();
		speeds.put(0, new Color(0, 255, 255));
		speeds.put(20, new Color(0, 255, 255));
		speeds.put(35, new Color(0, 153, 255));
		speeds.put(50, new Color(0, 51, 255));
		speeds.put(70, new Color(51, 255, 51));
		speeds.put(90, new Color(0, 153, 0));
		speeds.put(110, new Color(250, 255, 2));
		speeds.put(150, new Color(236, 7, 26));

		// used for consumptions profile
		Map<Integer, Color> consumptions = new HashMap<Integer, Color>();
		consumptions.put(0, Color.GREEN);
		consumptions.put(15, Color.YELLOW);
		consumptions.put(30, Color.BLUE);
		consumptions.put(100, Color.RED);

		// used for rpm profile
		Map<Integer, Color> rpm = new HashMap<Integer, Color>();
		rpm.put(0, Color.GREEN);
		rpm.put(1000, Color.YELLOW);
		rpm.put(3000, Color.BLUE);
		rpm.put(6000, Color.RED);

		mapColors.put(ReqParam.SPEED.value(), new AwtColorSelector(speeds));
		minValues.put(ReqParam.SPEED.value(), 0);
		maxValues.put(ReqParam.SPEED.value(), 150);
		//
		// mapColors.put(TypeValue.CONSUMPTION.value(), new AwtColorSelector(
		// consumptions));
		// minValues.put(TypeValue.CONSUMPTION.value(), 0);
		// maxValues.put(TypeValue.CONSUMPTION.value(), 100);
		//
		// mapColors.put(TypeValue.RPM.value(), new AwtColorSelector(rpm));
		// minValues.put(TypeValue.RPM.value(), 0);
		// maxValues.put(TypeValue.RPM.value(), 6000);

	}

	public Map<String, AwtColorSelector> getColors() {
		return mapColors;
	}

	public Map<String, Integer> getMinValues() {
		return minValues;
	}

	public Map<String, Integer> getMaxValues() {
		return maxValues;
	}

}
